/**
 * Created by user on 2018/3/29.
 */
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { getStamp } from '../utils/Global'
import GlobalTitle from './globalTitle'
import { NotStartAction } from '../actions'
class ReplayNotStartMask extends Component {
  clickBtn = () => {
    const { showTip, dispatch } = this.props
    const { toggleTip } = NotStartAction
    dispatch(toggleTip(false))
  }
  renderMask() {
    const { showTip } = this.props
    return showTip ? (
      <div className="error_mask">
        <div className="error_mask_table">
          <div className="error_mask_table_inner">
            <div className="error_mask_real">
              <div className="error_mask_title">提示</div>
              <div className="error_mask_content">直播未开始</div>
              <div onClick={this.clickBtn} className="error_mask_btn">知道了</div>
            </div>
          </div>
        </div>
      </div>
    ) : null
  }
  render() {
    const { info } = this.props
    return (
      <div>
        <GlobalTitle/>
        <div className="not_start_mask">
          <div className="not_start_image" style={{ backgroundImage: 'url(' + info.cover + ')' }}></div>
          {this.renderMask()}
        </div>
      </div>
    )
  }
}
const mapStateToProps = (state) => {
  return Object.assign({}, state.NotStartState, {
    info: state.MainScreenState.info
  })
}
export default connect(mapStateToProps)(ReplayNotStartMask)
